This page last changed on Dec 13, 2004 by casey.

全局结果允许定义一个结果映射, 它可以作为全部活动的缺省结果, 并自动被本包及所有扩展包中的活动继承. 换言之, 如果你想为多个活动指定同一个结果, 就可以把它定义为全局结果.

示例
<package name="default">
....
<global-results> 
    <result name="login" type="dispatcher"> 
        <param name="location">login.jsp</param> 
    </result> 
</global-results> 
<action name="foo"  class="mypackage.fooAction">
    <result name="success" type="dispatcher">bar.jsp</result> 
</action>
<action name="submitForm"  class="mypackage.submitFormAction">
    <result name="success" type="dispatcher">submitSuccess.jsp</result> 
</action>
...
</package>

等同于
<package name="default">
....
<action name="foo"  class="mypackage.fooAction">
    <result name="success" type="dispatcher">bar.jsp</result> 
    <result name="login" type="dispatcher">login.jsp</result> 
</action>
<action name="submitForm"  class="mypackage.submitFormAction">
    <result name="success" type="dispatcher">submitSuccess.jsp</result>
    <result name="login" type="dispatcher">login.jsp</result>  
</action>
...
</package>

Document generated by Confluence on Dec 14, 2004 16:36